﻿#region Using Directives
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.ComponentModel.Design;
using NiSis.Entities;
using NiSis.Data;
using NiSis.Data.Bases;
#endregion

namespace NiSis.Web.Data
{
	/// <summary>
	/// Represents the DataRepository.VUtenzeNotInPoolProvider object that provides
	/// data to data-bound controls in multi-tier Web application architectures.
	/// </summary>
	[CLSCompliant(true)]
	[Designer(typeof(VUtenzeNotInPoolDataSourceDesigner))]
	public class VUtenzeNotInPoolDataSource : ReadOnlyDataSource<VUtenzeNotInPool>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the VUtenzeNotInPoolDataSource class.
		/// </summary>
		public VUtenzeNotInPoolDataSource() : base(DataRepository.VUtenzeNotInPoolProvider)
		{
		}

		#endregion Constructors
		
		#region Properties
		
		/// <summary>
		/// Gets a reference to the VUtenzeNotInPoolDataSourceView used by the VUtenzeNotInPoolDataSource.
		/// </summary>
		protected VUtenzeNotInPoolDataSourceView VUtenzeNotInPoolView
		{
			get { return ( View as VUtenzeNotInPoolDataSourceView ); }
		}
		
		#endregion Properties
		
		#region Methods

		/// <summary>
		/// Creates a new instance of the VUtenzeNotInPoolDataSourceView class that is to be
		/// used by the VUtenzeNotInPoolDataSource.
		/// </summary>
		/// <returns>An instance of the VUtenzeNotInPoolDataSourceView class.</returns>
		protected override BaseDataSourceView<VUtenzeNotInPool, Object> GetNewDataSourceView()
		{
			return new VUtenzeNotInPoolDataSourceView(this, DefaultViewName);
		}
		
		/// <summary>
        /// Creates a cache hashing key based on the startIndex, pageSize and the SelectMethod being used.
        /// </summary>
        /// <param name="startIndex">The current start row index.</param>
        /// <param name="pageSize">The current page size.</param>
        /// <returns>A string that can be used as a key for caching purposes.</returns>
		protected override string CacheHashKey(int startIndex, int pageSize)
        {
			return String.Format("{0}:{1}:{2}", SelectMethod, startIndex, pageSize);
        }
		
		#endregion Methods
	}
	
	/// <summary>
	/// Supports the VUtenzeNotInPoolDataSource control and provides an interface for
	/// data-bound controls to perform data operations with business and data objects.
	/// </summary>
	public class VUtenzeNotInPoolDataSourceView : ReadOnlyDataSourceView<VUtenzeNotInPool>
	{
		#region Declarations

		#endregion Declarations
		
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the VUtenzeNotInPoolDataSourceView class.
		/// </summary>
		/// <param name="owner">A reference to the VUtenzeNotInPoolDataSource which created this instance.</param>
		/// <param name="viewName">The name of the view.</param>
		public VUtenzeNotInPoolDataSourceView(VUtenzeNotInPoolDataSource owner, String viewName)
			: base(owner, viewName)
		{
		}
		
		#endregion Constructors
		
		#region Properties

		/// <summary>
		/// Gets a strongly-typed reference to the Owner property.
		/// </summary>
		internal VUtenzeNotInPoolDataSource VUtenzeNotInPoolOwner
		{
			get { return Owner as VUtenzeNotInPoolDataSource; }
		}

		/// <summary>
		/// Gets a strongly typed reference to the Provider property.
		/// </summary>
		internal VUtenzeNotInPoolProviderBase VUtenzeNotInPoolProvider
		{
			get { return Provider as VUtenzeNotInPoolProviderBase; }
		}

		#endregion Properties
		
		#region Methods
		
		#endregion Methods
	}

	#region VUtenzeNotInPoolDataSourceDesigner

	/// <summary>
	/// Provides design-time support in a design host for the VUtenzeNotInPoolDataSource class.
	/// </summary>
	public class VUtenzeNotInPoolDataSourceDesigner : ReadOnlyDataSourceDesigner<VUtenzeNotInPool>
	{
	}

	#endregion VUtenzeNotInPoolDataSourceDesigner

	#region VUtenzeNotInPoolFilter

	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilter&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="VUtenzeNotInPool"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class VUtenzeNotInPoolFilter : SqlFilter<VUtenzeNotInPoolColumn>
	{
	}

	#endregion VUtenzeNotInPoolFilter

	#region VUtenzeNotInPoolExpressionBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlExpressionBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="VUtenzeNotInPool"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class VUtenzeNotInPoolExpressionBuilder : SqlExpressionBuilder<VUtenzeNotInPoolColumn>
	{
	}
	
	#endregion VUtenzeNotInPoolExpressionBuilder		
}

